package 斐波那契数列;

/*
可以跳n级的青蛙
 */
public class Frog
{
    public int JumpFloorII(int target)
    {
        if (target < 0)
            return -1;
        return (int) Math.pow(2, target - 1);
    }

    public int JumpFloorII1(int target)
    {
        if (target <= 0)
            return -1;
        else if (target == 1)
            return 1;
        else
            return 2 * JumpFloorII1(target - 1);

    }
}
